{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Repeated Choropleth Map\n",
    "=======================\n",
    "Three choropleths representing disjoint data from the same table.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# category: geographic\n",
    "\n",
    "import altair as alt\n",
    "alt.data_transformers.enable('json')\n",
    "from vega_datasets import data\n",
    "\n",
    "states = alt.topo_feature(data.us_10m.url, 'states')\n",
    "\n",
    "pop_eng_hur = data.population_engineers_hurricanes.url\n",
    "\n",
    "variable_list = ['population', 'engineers', 'hurricanes']\n",
    "\n",
    "alt.Chart(states).mark_geoshape().encode(\n",
    "    alt.Color(alt.repeat('row'), type='quantitative')\n",
    ").transform_lookup(\n",
    "    lookup='id',\n",
    "    from_=alt.LookupData(pop_eng_hur, 'id', variable_list)\n",
    ").properties(\n",
    "    width=500,\n",
    "    height=300\n",
    ").project(\n",
    "    type='albersUsa'\n",
    ").repeat(\n",
    "    row=variable_list\n",
    ").resolve_scale(\n",
    "    color='independent'\n",
    ")\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "env": {},
   "interrupt_mode": "signal",
   "language": "python",
   "metadata": {},
   "name": "python3"
  },
  "language": "python"
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
